#include "using.h"
#include "../CXMLFactoryEnvironment.h"
#include <lampe/xml/IFactoryRecord.h>
#include <lampe/xml/IXmlNode.h>
namespace lampe{
namespace xml{
class UsingactoryRecord:public lampe::xml::IFactoryRecord{
	virtual lampe::xml::TagResult tagHandlerBefor(lampe::xml::IXMLFactoryEnvironment*environment,lampe::xml::IXmlNode*node){
		if (node->getAttString("href")=="")
			return lampe::xml::STOP;
		lampe::xml::IXmlNode*root=environment->createXmlTree(node->getAttString("href"));
		if (root){
			environment->runNode(root);
			root->drop();
			return lampe::xml::NEXT;
		}
		return lampe::xml::STOP;
	}
	
	virtual LAMPE_VECTOR_VENDOR<String> getProcessedTags(){
		LAMPE_VECTOR_VENDOR<String> res;
		res.push_back("using");
		return res;
	};
};
}//namespace xml
}//namespace lampe
void regUsing(lampe::xml::CXMLFactoryEnvironment*environment){
	lampe::xml::UsingactoryRecord*temp=new lampe::xml::UsingactoryRecord();
	environment->registerHandler(temp);
	temp->drop();
}
